<?php

namespace App\Admin\Controllers;

use App\Admin\Models\Company;
use App\Admin\Models\Logs;
use Illuminate\Support\Facades\Auth;

class IndexController extends Controller
{
    /*
     * 平台首页页面
     * @author turtle
     * create_time 2017-01-04
     */

    public function index()
    {
        $user = Auth::user();
        $company = Company::get();
        $datas['company'] = $company;
        return view('admin.index', $datas);
    }

    public function logout()
    {
        $mobile = Auth::user()->mobile;
        $log = $mobile . "退出登录成功";
        Logs::addLog($log);
        Auth::logout();

        return redirect()->route('admin.logout');
    }


    public function profile()
    {
        return view('voyager::profile');
    }
}
